package com.easy.core.param;

import java.util.HashSet;
import java.util.Set;

import net.sf.json.JSONException;
import net.sf.json.JSONObject;

/**
 * 描述:全局常量
 * @package com.fs.util
 * @class GlobalConst
 */
public class GlobalConst {
	public static final String 	TREE_ROOT_ID = "ROOT";		//树的根节点ID
	public static final Integer SUPER_OPERATOR_ID = -1;		//超级管理员ID
	public static final String 	SUPER_ROLE_ID = "SUPER";	//超级管理员角色ID
	public static final String  HTTP_CURRENT_OPERATOR_KEY = "HTTP_CURRENT_OPERATOR_KEY";	//登录时记录在session中的用户对象key
	public static final String HTTP_SESSIN_RANDOM_AUTH_CODE_KEY = "HTTP_SESSIN_RANDOM_AUTH_CODE_KEY";	//登录时记录在session中的随机验证码key

	
	public static Set<String> NO_PERMIT = new HashSet<String>();	//不需要进行权限校验，只要登录就可以
	static{
		//NO_PERMIT.add("/base/menu!panelTree.action");	//设置
	}
	
	public static String returnFalse(String msg) throws JSONException{
		JSONObject obj = new JSONObject();
		obj.put("b", false);
		obj.put("msg", msg+"");
		return obj.toString();
	}
	
	public static String returnTrue(String msg) throws JSONException{
		JSONObject obj = new JSONObject();
		obj.put("b", true);
		obj.put("msg", msg+"");
		return obj.toString();
	}
}
